package com.jml.并行计算;


import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author:jml
 * @date: 2019/6/20 0020 22:31
 * @description：(B+C)*B/2
 */
public class Div implements Runnable {

    public static BlockingQueue<Msg> bq =new LinkedBlockingQueue<Msg>();

    @Override
    public void run() {
        while (true) {
            try {
                Msg msg = bq.take();
                msg.i = msg.i / 2; //i*(i+j)/2
                System.out.println(msg.orgStr + "=" + msg.i);
            } catch (InterruptedException e) {
            }
        }
    }
}
